<?php
global $_W,$_GPC;
$pcset = pdo_get('goouc_class_pcsetting',array('weid'=>$_W['uniacid']));
if(checksubmit('submit')){
    $id = $_GPC['id'];
    if(empty($_GPC['title'])){
        itoast('网站标题不能为空');
    }
    $data['weid'] = $_W['uniacid'];
    $data['title'] = $_GPC['title'];
    $data['pc_appid'] = $_GPC['pc_appid'];
    $data['pc_secret'] = $_GPC['pc_secret'];
    $data['icon'] = $_GPC['icon'];
    $data['keywords'] = $_GPC['keywords'];
    $data['logo_title'] = $_GPC['logo_title'];
    $data['logo'] = $_GPC['logo'];
    $data['description'] = $_GPC['description'];
    $data['qq'] = $_GPC['qq'];
    $data['phone'] = $_GPC['phone'];
    $data['keepon'] = $_GPC['keepon'];
    $data['qrcode'] = $_GPC['qrcode'];
    $data['xqrcode'] = $_GPC['xqrcode'];
    $data['address'] = $_GPC['address'];
    if(empty($pcset)){
        $res = pdo_insert('goouc_class_pcsetting',$data);
    }else{
        $res = pdo_update('goouc_class_pcsetting',$data,array('id'=>$id,'weid'=>$_W['uniacid']));
    }
    if($res){
        message('设置成功',$this->createWebUrl('pcsetting'));
    }
}
include $this->template('web/pcsetting');
?>